package com.jswdwsx.esign.service.mapper

import com.jswdwsx.esign.cloud.request.SignReq
import com.jswdwsx.esign.entity.RequestPO
import com.jswdwsx.esign.entity.RequestStatusEnum

/**
 * @author jiangyuwen@jswdwsx.com
 * @version V1.0
 * @since 1.0 2019/7/13 15:02
 * @description 将每次业务发起的一次签署请求转成一个request
 */

class Mapper {
    companion object {
        fun map(signReq: SignReq): RequestPO {
            return RequestPO(
                id = null,
                appId = signReq.appId,
                appSerialNumber = signReq.appSerialNumber,
                templateId = signReq.templateId,
                signerName = signReq.signerName,
                signerIdType = signReq.signerIdType,
                signerIdNumber = signReq.signerIdNumber,
                signerMobile = signReq.signerMobile,
                identityType = signReq.identityType,
                orgName = signReq.orgName,
                orgIdType = signReq.orgIdType,
                orgIdNumber = signReq.orgIdNumber,
                notifyUrl = signReq.notifyUrl,
                redirectUrl = signReq.redirectUrl,
                status = RequestStatusEnum.Created,
                fileFillParam = signReq.fileFillParam,
                seals = signReq.seals
            )
        }
    }
}